##
## Makefile for my_script in /home/kolly_g/windows/projets/tek2/my_script
##
## Made by guillaume kolly
## Login   <kolly_g@epitech.net>
##
## Started on  Tue Mar 16 19:16:27 2010 guillaume kolly
## Last update Wed Nov 10 20:55:15 2010 yoann1 minot
##

#================================ Name of Project ===================================

PROJ_NAME		=	Combat

#============================== Sources of project ==================================

OBJS			=	$(OBJSDIR)/main.o

#=================================== Directory ======================================
SRCSDIR			=	src
OBJSDIR			=	objs
INCDIR			=	include

#================================= Arch Commands ====================================
######################### FreeBSD
CC_FreeBSD		=	/usr/bin/gcc -g
RM_FreeBSD		=	/bin/rm -f
ECHO_FreeBSD		=	/bin/echo
CP_FreeBSD		=	/bin/cp
PRINTF_FreeBSD		=	/usr/bin/printf
CLEAN_FeeBSD		=	/bin/clean

######################### ia-64-linux
CC_ia64-linux		=	/usr/bin/gcc
RM_ia64-linux		=	/bin/rm -f
ECHO_ia64-linux		=	/bin/echo
CP_ia64-linux		=	/bin/cp
PRINTF_ia64-linux	=	/usr/bin/printf
CLEAN_ia64-linux	=	/bin/clean

######################### sun4
CC_sun4			=	/usr/sfw/bin/gcc
RM_sun4			=	/usr/bin/rm -f
ECHO_sun4		=	/usr/bin/echo
CP_sun4			=	/usr/bin/cp
PRINTF_sun4		=	/usr/bin/printf
CLEAN_sun4		=	/usr/bin/clean

######################### powerpc
CC_powerpc		=	/usr/bin/gcc
RM_powerpc		=	/bin/rm -f
ECHO_powerpc		=	/bin/echo
CP_powerpc		=	/bin/cp
PRINTF_powerpc		=	/usr/bin/printf
CLEAN_powerpc		=	/usr/site/bin/clean

#################################################
CC			=	$(CC_$(HOSTTYPE))
CP			=	$(CP_$(HOSTTYPE))
ECHO			=	$(ECHO_$(HOSTTYPE))
RM			=	$(RM_$(HOSTTYPE))
PRINTF			=	$(PRINTF_$(HOSTTYPE))
CLEAN			=	$(CLEAN_$(HOSTTYPE))

#================================= Compilation effects ============================

NAME			=	$(PROJ_NAME)

M_TYPE			=	`uname -m`
H_TYPE			=	`uname -s`

LIBS			+=	-L/home/minot_a/SDL/lib -Wl,-rpath,/home/minot_a/SDL/lib -lSDL -pthread
INCLUDE			+=	-I./$(INCDIR)/

###################### Compilation flags
CFLAGS			+=	-W -Wall -Wstrict-prototypes -ansi -pedantic $(INCLUDE)


#================================== Compilation Rules ==============================

$(NAME):		$(OBJS)
			@$(ECHO) "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+"
			@$(ECHO) "[LOAD]  $(NAME)"
			@$(CC) -o $(NAME) $(OBJS) $(LIBS)

all:			$(NAME)

################### Sources Rules

objs/main.o : src/main.c
	@$(PRINTF) "[CC]    %-20s \t=>\t%s\n" $? $@
	@$(CC) $(CFLAGS) $(INCLUDE) -o $@ -c $?

################### Waching Rules
clean:
			@$(PRINTF) "[RM]\tDeleting objects.\n"
			@$(RM) $(OBJS)
			@$(RM) \#*
			@$(PRINTF) "=================================================\n"
			@$(ECHO) "[CL]	Cleaning"
			@/usr/bin/find . -name "*~" -print -exec rm {} \;
			@$(PRINTF) "=================================================\n"


fclean:			clean
			@$(ECHO) "[RM]    $(NAME)"
			@$(RM) $(NAME)

re:			fclean all

tar:
			tar cf $(PROJ_NAME).tar ./*

.PHONY:			clean fclean re
